package com.zhongmeng.newsdemo.ui.fragment;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.zhongmeng.newsdemo.R;

import butterknife.ButterKnife;

/**
 * A simple {@link Fragment} subclass.
 */
public abstract class BaseFragment extends Fragment {
    private View rootView;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        rootView=inflater.inflate(getLayoutId(), container, false);
        ButterKnife.bind(this,rootView);
        initView();
        addListener();
        return rootView;
    }

    public abstract int getLayoutId();
    public abstract void initView();
    public abstract void addListener();

}
